rendernode: Use ceilf() on the size of the cairo surface
authorBenjamin Otte <otte@redhat.com>
Tue, 1 Nov 2016 02:40:01 +0000 (03:40 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 1 Nov 2016 02:40:01 +0000 (03:40 +0100)
Bounds sizes are floats, so round up to the next integer so we end up
with enough space to draw.

gsk/gskrendernode.c

index 6d2cf8785d84c458ff63de6d25a2a3899c2132de..85cf2466a65a8fe632cb8777b1a5958aa2368cb5 100644 (file)
@@ -49,6 +49,8 @@
 
 #include <graphene-gobject.h>
 
+#include <math.h>
+
 #include <gobject/gvaluecollector.h>
 
 /**
@@ -1416,8 +1418,8 @@ gsk_render_node_get_draw_context (GskRenderNode *node)
       node->surface = gsk_renderer_create_cairo_surface (node->renderer,
                                                          node->opaque ? CAIRO_FORMAT_RGB24
                                                                       : CAIRO_FORMAT_ARGB32,
-                                                         node->bounds.size.width,
-                                                         node->bounds.size.height);
+                                                         ceilf (node->bounds.size.width),
+                                                         ceilf (node->bounds.size.height));
     }
 
   res = cairo_create (node->surface);